<?php

use yii\helpers\Html;
use yii\grid\GridView;

/* @var $this yii\web\View */
/* @var $searchModel app\models\search\AuthOrderSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = '订单管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="auth-order-index">
    <p>
        <?= Html::a('批量导入订单', ['create'], ['class' => 'btn btn-success']) ?>
    </p>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>

    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            [
                'attribute'=>'auth_app_id',
                'filter'=>\app\models\AuthApp::getOptions(),
                'format'=>'raw',
                'value'=>function($model){
                    return $model->authApp->title;
                }
            ],
            [
                'attribute'=>'auth_shop_id',
                'filter'=>false,
                'format'=>'raw',
                'value'=>function($model){
                    return $model->authShop->name;
                }
            ],
            'order_no',
            'pay_fee',
            [
                'attribute'=>'status',
                'options' => ['width' => '80px'],
                'filter'=>\app\models\AuthOrder::$state_arr,
                'format'=>'raw',
                'value'=>function($model){
                    return $model->showState();
                }
            ],
        ],
    ]); ?>


</div>
